Skip to content

Conversation

@hugues-m
Copy link
Contributor

Hi again :)

This one is more tricky.
During compilation of a next app with server component, sometime the createModal() call happens in 2 different contexts.

The result is a server rendering with ${uncapitalize(name)}-modal-0 and a client bundle with ${uncapitalize(name)}-modal-1

This has caused us a bug during hydration (aria-controls of the hidden modal control button are different), but also the button does not work in production at all since the aria-controls prop have a different id than the modal.

I am ok with the developers having the responsibility of putting unique modal names (as when using basic dsfr js)
But I am aware that this PR is a BC break for this component, what do you think ?

…erver component and client bundling with next app directory
@garronej
Copy link
Collaborator

During compilation of a next app with server component

Say no more, you are right, I was wrong.

Let's leave the devs the resposability of enforcing uniqueness of names.

Thank you for this other good contribution 👍🏻

@garronej garronej merged commit 0e0dd50 into codegouvfr:main May 10, 2023
sbourdon13 pushed a commit to sbourdon13/react-dsfr that referenced this pull request Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants